<template>
	<view >
		<mescroll-uni ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :up="upOption" :top="230">
			<view v-for="(item,index) in list" :key="index">
				<listItem :item="item"/>
			</view>			
		</mescroll-uni>
	</view>
</template>

<script>
	import {getFormList, repairManageList} from '../../../api/message.js';
	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
	import listItem from './listItem.vue'
	export default {
		name:"repair",
		mixins: [MescrollMixin], // 使用mixin
		components:{
			listItem
			// Scroll
		},

		onLoad() {
			
		},
		data() {
			return {
				list:[],
				page:{
					pageIndex:1,
					pageSize:5
				},
				pages:0,
				upOption:{
					auto:false
				}
			};
		},
		methods:{
			pullDown(done){
				setTimeout(done,2000)
			},
			 downCallback(){
				this.list = []
				this.mescroll.resetUpScroll( true )					
			},
			async upCallback(page){
				let params = {
					pageIndex:page.num,
					pageSize:page.size
				}
				let res = await repairManageList(this.page)
				if(res.result === '1'){
					this.mescroll.endSuccess(res.rows.length)
					this.list = [...this.list,...res.rows]
				} else {
					this.mescroll.endErr()
				}
			}
		}
	}
</script>

<style lang="scss" scoped>

</style>
